package lesson5;

import java.util.Arrays;

public class task4 {
	
	public static void main(String[] args) {
		
		int[] array = {1,1,0,0,1,0,1,1,1,0};
		
		int countZeroes = 0;
		for(int i = 0; i < array.length; i++)
		{
			if(array[i] == 0)
				countZeroes++;
		}
		
		for(int i = 0; i < array.length; i++)
		{
			if(countZeroes != 0)
			{
				array[i] = 0;
				countZeroes--;
			}
			else
			{
				array[i] = 1;
			}
		}
		
		System.out.println(Arrays.toString(array));
	}
}
